<template>
  <div class="basic-info">
    <TitleHeader name="职业定义" />
    <div class="major-intro">
      <van-text-ellipsis
        rows="3"
        :content="info?.definition"
        expand-text="展开"
        collapse-text="收起"
      />
    </div>
    <TitleHeader name="主要工作任务" />
    <div class="major-intro">
      <div class="task-item" v-for="(item, index) in info?.task" :key="index">
        {{ index + 1 }}. {{ item }}
      </div>
    </div>
    <TitleHeader name="职业其他名称" />
    <div class="first-block">
      <div
        class="first-item"
        v-for="(item, index) in info?.otherNames"
        :key="index"
      >
        {{ item }}
      </div>
    </div>
  </div>
</template>

<script setup>
import { onMounted, ref, watch } from 'vue';
import TitleHeader from './TitleHeader.vue';

const props = defineProps({
  info: {
    type: Object,
    default: () => {},
  },
});
</script>

<style lang="scss" scoped>
.basic-info {
  width: 100%;
  height: 100%;
  padding: 40px;
  box-sizing: border-box;
  overflow-y: auto;
  .first-block {
    display: flex;
    align-items: center;
    gap: 16px;
    .first-item {
      font-size: 24px;
      background: #fff;
      border-radius: 8px;
      padding: 12px 30px 12px 30px;
      border: 1px solid $border-color;
    }
  }
  .major-intro {
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    font-size: 24px;
    color: #333333;
    line-height: 47px;
    margin-bottom: 45px;
  }
}
</style>
